package com.niit.spark.sql.test

import org.apache.spark.sql.functions.col
import org.apache.spark.sql.{DataFrame, SparkSession}

/**
 * Date:2025/5/16
 * Author：Ys
 * Description:
 */
object UnionDataFrames {

  def main(args: Array[String]): Unit = {
    val spark: SparkSession = SparkSession.builder().appName("UnionDataFrames").master("local[*]").getOrCreate()
    spark.sparkContext.setLogLevel("ERROR")

    val df1: DataFrame = spark.read.option("header", "true").csv("input/sql/df1.csv")
    val df2: DataFrame = spark.read.option("header", "true").csv("input/sql/df2.csv")

    df1.union(df2).show()

    spark.stop()

  }

}
